﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace EF6Query.DBModel
{

    /// <summary>
    /// 产品表
    /// </summary>
    [Table("Product")]
    public class Product
    {
        /// <summary>
        /// 产品id，自增
        /// </summary>
        public int ID { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        public static Product CreateObject(int id, string productName, DateTime createTime, DateTime updateTime)
        {
            return new Product { ID = id, ProductName = productName, CreateTime = createTime, UpdateTime = updateTime };
        }
    }

}
